package com.lw.yygh.model.hosp;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * Hospital
 * </p>
 *
 * @author qy
 */
@Data
@Document("hospital")
public class Hospital  {
	
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Indexed(unique = true) //唯一索引
	private String hoscode;

	@Indexed //普通索引
	private String hosname;
	//医院类型
	private String hostype;

	private String provinceCode;

	private String cityCode;
	//区编码
	private String districtCode;

	private String address;
	//医院logo
	private String logoData;
	//医院简介
	private String intro;
	//坐车路线
	private String route;
	//是否上线
	private Integer status;

	//预约规则
	private BookingRule bookingRule;

	public void setBookingRule(String bookingRule) {
		this.bookingRule = JSONObject.parseObject(bookingRule, BookingRule.class);
	}

	private Date createTime;

	private Date updateTime;

	private Integer isDeleted;

	@Transient //被该注解标注的，将不会被录入到数据库中。只作为普通的javaBean属性
	private Map<String,Object> param = new HashMap<>();
}

